home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / nelson / iostruct.h < prev   
Encoding:
C/C++ Source or Header  |  1994-01-12  |  2.6 KB  |  86 lines

  1. /* ----------------------------------------------------
  2.  *  iostruct.h
  3.  *
  4.  *  Block IOCTL-related structures.
  5.  *  Enable byte-packing of structures
  6.  * ------------------------------------------------- */
  7.  
  8. #ifndef __IOSTRUCT_H
  9. #define __IOSTRUCT_H
  10.  
  11. //BIOS parameter block ......
  12. struct BPBlock  {
  13.     int bps;    //bytes/sector
  14.     char spc;   //sectors/cluster
  15.     int rs;     //reserved sectors
  16.     char nfat;  //#copies fat
  17.     int rds;   //root dir size (#entries)
  18.     unsigned stot; //total# sectors
  19.     char md;    //media descriptor
  20.     int spf;    //#sectors/fat
  21.     int spt;    //#sectors/track
  22.     int nheads; //#heads (sides)
  23.     long nhid;  //hidden sectors
  24.     long nsect;  //total sects if stot == 0
  25.     };
  26.  
  27. struct DEVICEPARAMS  {
  28.     char spfun;      //special function field
  29.     char device_type;   //type of block device
  30.     int device_attr;    //device attributes
  31.     unsigned numcyl;    //total# cylinders
  32.     char media_type;
  33.     struct BPBlock bptab;
  34.     //Offset to next field indicates location of
  35.     //start of track layout table. Table length
  36.     //in bytes = (sectors_per_track x 4) + 2 ....
  37.     char beg_track_layout;
  38.     };
  39.  
  40. struct RWBLOCK {
  41.     char    spfun;      //special function = 0
  42.     int     disk_head;
  43.     int     disk_cylinder;  //cylinder# (0-based)
  44.     int     first_sector;   //1st sect# (0-based)
  45.     int     xfer_count;     //#sectors to transfer
  46.     void far *xfer_buf;     //-> read/write buffer
  47.     };
  48.  
  49. struct MID    {
  50.     int info;       //information level (=0)
  51.     unsigned long sernum;  //disk serial number
  52.     char volume[11];    //disk volume label
  53.     char fattype[8];    //file (fat) system type,
  54.                         //either:
  55.                         //"FAT12  " or "FAT16  "
  56.     };
  57.  
  58. struct MTYPE {
  59.     char flag;  //0 = media is NOT default type
  60.                 //1 = media is default type
  61.     char type;  //2 = 720Kb disk
  62.                 //7 = 1.44Mb disk
  63.                 //9 = 2.88Mb disk
  64.     };
  65.  
  66. struct SPECIALFUNC {
  67.     char    spfunc;     //special function (=0)
  68.     char    acc_flag;   //= 0 if access blocked;
  69.                         //media not formatted
  70.     };
  71.  
  72. struct FVBLOCK    {
  73.     char spfunc;    //special functions:
  74.                     //0 = Format/verify
  75.                     //1 = chk for ROM support
  76.                     //2 = Fast format (?)
  77.     int  disk_head;     //head#
  78.     int  disk_cylinder;  //cylinder# (0-based)
  79.     int num_tracks; //#tracks to verify (used only
  80.                     //if spfunc = 2)
  81.     };
  82.  
  83. #endif   //__IOSTRUCT_H
  84.  
  85. /* ----- End of File ------------------------------- */
  86.